import time
from os import times

import allure
from selenium.webdriver.common.by import By

from base.webkeys import WebKeys
from locator.allPages_data import *


class OpportunityPage(WebKeys):
    def opportunity_type(self):
        # 点击机会tab
        with allure.step("点击机会tab"):
            self.on_click(*the_Opportunity_tab)
        with allure.step("判断商机类型（存量非空户）成功显示在页面"):
            locator = ("xpath", '//*[@id="index"]/div[2]/div/div[2]/div/div/div/div[1]/div/div[5]')
            result=self.get_text(*locator)
        return result

    def opportunity_status(self):
        # 点击机会tab
        with allure.step("点击机会tab"):
            self.on_click(*the_Opportunity_tab)
        with allure.step("判断商机状态（已跟进）成功显示在页面"):
            locator = ("xpath", '//*[@id="index"]/div[2]/div/div[2]/div/div/div/div[2]/div[1]/button[2]')
            result=self.get_text(*locator)
        return result